#!/bin/bash
UPGRADEMODE="--upgrade-mode"
ERR=$(echo -e "Opps! Something went wrong\!, \n please try again later"; echo)
UPGM=$(echo -e "Upgrade System"; echo);
if [ -s /usr/share/urukUpdater/status/upd.list ]; then
        zenity --text-info  --title="packages needed to be upgrad" --ok-label="$UPGM" --filename=/usr/share/urukUpdater/status/upd.list  --width=310 --height=450 --window-icon=/usr/share/pixmaps/urukupdater.svg;
        rc=$?
            case $rc in
                0)
                  pkexec /usr/sbin/synaptic --hide-main-window $UPGRADEMODE --non-interactive --parent-window-id %d;
                ;;
                1)
                  exit 0
                ;;
                -1)
                  zenity --error --text="$ERR " --width=200 --height=130 --icon-name=/usr/share/urukUpdater/pixmap/error.svg --window-icon=/usr/share/pixmaps/urukupdater.svg;
                ;;
            esac
else
        zenity --info --title="Updateing list" --text="Your system is up-to-date!" --ok-label="Ok" --width=300 --height=100 --window-icon=/usr/share/urukUpdater/pixmap/ok.svg;
fi
